<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <script src="https://unpkg.com/react@18.1.0/umd/react.development.js"></script>
    <script src="https://unpkg.com/react-dom@18.1.0/umd/react-dom.development.js"></script>
    <script src="https://unpkg.com/babel-standalone@6.15.0/babel.min.js"></script>
    <title>Document</title>
  </head>
  <body>
    <div id="app"></div>
    <script type="text/babel">
      class App extends React.Component {
        render() {
          return (
            <div>
              <h3>App组件</h3>
              <ul>
                <LiCom />
              </ul>
            </div>
          );
        }
      }
      class LiCom extends React.Component {
        // <React.Fragment> 把它作为空标签使用，既不会额外的生成标签，又可以作为组件的根元素使用，起到包裹的作用。简写：<></>
        render() {
          return (
            <React.Fragment>
              <li>1</li>
              <li>2</li>
              <li>3</li>
              <li>4</li>
            </React.Fragment>
          );
        }
      }
      ReactDOM.render(<App />, document.getElementById("app"));
    </script>
  </body>
</html>
